
package com.be.beadmin.quality.service;

import com.be.beadmin.common.entity.PageEntity;
import com.be.beadmin.product.entity.ProductManufactInfor;
import com.be.beadmin.product.entity.WorkOrderInfor;
import com.be.beadmin.project.entity.BatchPlan;
import com.be.beadmin.quality.dto.input.InspectionInfoAllDto;
import com.be.beadmin.quality.dto.input.InspectionInfoAllEx;
import com.be.beadmin.quality.dto.input.InspectionTaskDto;
import com.be.beadmin.quality.dto.output.InspectionTaskEx;
import com.be.beadmin.quality.entity.InspectionTask;
import com.be.beadmin.quality.entity.InspectionTemplate;
import org.springframework.data.domain.Page;

import javax.servlet.http.HttpServletRequest;
import java.util.List;

/**
* @description 服务接口
* @author zjm
* @date 2023-05-28
**/
public interface InspectionTaskService {

    /**
    * 分页的查询接口
    * @param pageEntity
    * @return
    */
    Page<InspectionTaskEx> getInspectionTaskByPage(PageEntity pageEntity);

    /**
    * @param inspectionTaskDto
    */
    void addInspectionTask(InspectionTaskDto inspectionTaskDto);

    /**
    * @param inspectionTaskDto
    */
    void updateInspectionTask(InspectionTaskDto inspectionTaskDto);

    /**
    * @param id
    */
    void delInspectionTask(String id);

    /**
    * 删除多个角色
    * @param ids
    */
    void delInspectionTasks (List<String> ids);

    /**
     * 生成自检单
     * @param productManufactInfor
     * @param template
     */
    InspectionTask generateInspectionTask(ProductManufactInfor productManufactInfor, InspectionTemplate template);

    /**
     * 生成终检单
     * @param template
     */
    InspectionTask generateFinishInspectionTask(WorkOrderInfor workOrderInfor, InspectionTemplate template);


    /**
     * 生成交检单
     * @param template
     */
    InspectionTask generateSubmissionInspectionTask(BatchPlan batchPlan, InspectionTemplate template);

    /**
     * 根据id获取检验单详细内容
     * @param id
     * @return
     */
    InspectionInfoAllEx getInspectionTaskById(String id);

    /**
     * 根据id获取检验单详细内容
     * @param processId
     * @return
     */
    InspectionInfoAllEx getInspectionTaskValueByProcessId(String processId);

    /**
     * 提交检验单
     * @param inspectionInfoAllDto
     */
    void submitInspectionTask(HttpServletRequest request, InspectionInfoAllDto inspectionInfoAllDto);

    /**
     * 完成检验单
     * @param id
     */
    void finishInspectionTask(HttpServletRequest request,String id);

    InspectionTask getInspectionTaskByProductQualityId(String productQualityId);

    /**
     * 暂存检验单
     * @param inspectionInfoAllDto
     */
    void stagingInspectionTask(HttpServletRequest request,InspectionInfoAllDto inspectionInfoAllDto);

//    InspectionTask getInspectionTaskByBatchProductAndProcessType(String batchProductId,String processType);
}